home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 4 / United Public Domain Gold 4.iso / tbag / tb044.dms / tb044.adf / Docs / Requestor.DOCs < prev    next >
Text File  |  1990-06-07  |  4KB  |  116 lines

  1.  
  2.  
  3.     Requestor V1.0 - C. Papademetrious
  4.  
  5. Features:
  6.     * small (about 1500 bytes)
  7.     * easy to use
  8.     * uses ARP parsing for extended command line support and arguments
  9.     * user-settable return code
  10.     * ability to set return code on either positive or negative response
  11.     * ability to have a one-gadget requestor with user-defineable spacing
  12.     * automatically adjusts for fonts
  13.     * uses only as much space as needed in requestor window
  14.  
  15.  Requestor is a small CLI/Shell command I created after learning the
  16. essentials of script file commands, such as IF, SKIP, and others. It
  17. allows you to create Intuition requestors based on command line arguments,
  18. and then notifies the script via the WARN code (or other return code). I
  19. use it in my "C-Set" command in my C: directory, which is an executeable
  20. script to set up for my Manx compiler. It reads as follows:
  21.  
  22.  
  23. ;****************************************************************************
  24. ; stuff above here
  25. Requestor "Assign CCTEMP to:" "RAM:" "T:"
  26. IF WARN
  27.     CCTEMP=RAM:
  28.  ELSE
  29.     CCTEMP=T:
  30. ENDIF
  31. Requestor "Run XOper?" Yeah Naah SWAP
  32. IF WARN
  33.     Run PD:Xoper/Xoper
  34. ENDIF
  35. ; other init stuff follows
  36. ;****************************************************************************
  37.  
  38.  
  39.  I used the Requestor command to ask me where I wanted my temporary directory
  40. assigned to, and if I wanted to run XOper, a system monitor. This allows me
  41. to run my programs without having to type in the entire pathname. It also
  42. creates the possibility to have extreme flexibility in custom script files.
  43. For example, I could create an UnLHarc executeable script as follows:
  44.  
  45.  
  46. ;*** Custom UnLHArc *********************************************************
  47.  
  48. .key file
  49. Requestor "UnLHArc <file> to" T: VD0:
  50. IF WARN
  51.     Cd VD0:
  52.  ELSE
  53.     Cd T:
  54. ENDIF
  55.  
  56. LHArc x <file>
  57.  
  58. Requestor "Delete <file>?" Yes No SWAP
  59. IF WARN
  60.     Delete <file>
  61. ENDIF
  62.  
  63. Requestor Finished. 3 Continue IGNORE
  64.  
  65.  
  66. ;****************************************************************************
  67.  
  68. Format:
  69. Requestor <Message> <PositiveText OR Spacing> <NegativeText>
  70.     Optional:   [RET=<returnvalue>] [SWAP] [IGNORE]
  71.  
  72. The command line consists of three required arguments:
  73.     Message- main text of requestor, enclose in quotes if spaces used
  74.     PositiveText- text for left gadget, enclose in quotes if...
  75.     NegativeText- text for right gadget, enclose in quotes if...
  76.  
  77. The other arguments:
  78.     RET=<returnvalue>- use this to set your own return code. Default is
  79.         5 (WARN status)
  80.     SWAP- include this to have the failat code set when the POSITIVE, not
  81.         the NEGATIVE gadget is set. This is useful for questions best
  82.         phrased a certain way (Do you want to abort this script?
  83.                                             <YES> <NO>
  84.     IGNORE- this ignores the PositiveText gadget, but the PositiveText
  85.         argument is still needed. It is now used as a number to specify the
  86.         space in space characters the NegativeText gadget should be
  87.         pushed to the right.
  88.  
  89. Examples:
  90.  
  91.     Requestor "Shall I continue?" YES NO
  92.         Asks "Shall I continue?"; sets WARN flag if user selects NO
  93.  
  94.     Requestor "Shall I continue?" YES NO SWAP
  95.         Asks "Shall I continue?"; sets WARN flag if user selects YES
  96.  
  97.     Requestor "Assign T: to:" FH0:T RAM:T
  98.         Asks "Assign T: to:", gives choices "FH0:T" and "RAM:T"; sets WARN
  99.         flag if user selects RAM:T
  100.  
  101.     Requestor "Run DiskMaster in" INTERLACE NON-INTERLACE SWAP RET=10
  102.         Asks "Run DiskMaster in", gives choices "INTERLACE" and
  103.         "NON-INTERLACE"; returns code 10 if INTERLACE chosen
  104.  
  105. ----------------------------------------------------------------------------
  106.  
  107.     Questions? Comments? DONATIONS??? Please contact:
  108.  
  109.     Chris Papademetrious
  110.     217 Linda Terrace
  111.     Ephrata, PA  17522
  112.  
  113.         (any feedback GREATLY appreciated, and WILL be answered)
  114.  
  115.     and KEEP PUBLIC DOMAIN ALIVE! 
  116.